package io.renren.modules.PCguanli.controller;

import java.util.Arrays;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.renren.modules.PCguanli.entity.LineEntity;
import io.renren.modules.PCguanli.service.LineService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;



/**
 * 排队表
 *
 * @author zhangdanxiaozu
 * @email dan.zhang@zju.edu.cn
 * @date 2024-03-30 19:26:28
 */
@RestController
@RequestMapping("PCguanli/line")
public class LineController {
    @Autowired
    private LineService lineService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("PCguanli:line:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = lineService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{numberre}")
    @RequiresPermissions("PCguanli:line:info")
    public R info(@PathVariable("numberre") Integer numberre){
		LineEntity line = lineService.getById(numberre);

        return R.ok().put("line", line);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("PCguanli:line:save")
    public R save(@RequestBody LineEntity line){
		lineService.save(line);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("PCguanli:line:update")
    public R update(@RequestBody LineEntity line){
		lineService.updateById(line);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("PCguanli:line:delete")
    public R delete(@RequestBody Integer[] numberres){
		lineService.removeByIds(Arrays.asList(numberres));

        return R.ok();
    }

}
